<!-- head -->
{include file='public/head' /}
<!-- head -->
<!-- left -->
{include file='public/left' /}
<!-- left -->

<div class="content-wrapper">
    <!-- Content Header (Page header) -->
    <section class="content-header">
        <h1>
            更换手机号
            <small>严格审核</small>
        </h1>
        <ol class="breadcrumb">
            <li><a href="#"><i class="fa fa-dashboard"></i> 人员管理</a></li>
            <li><a href="#">员工列表</a></li>
            <li class="active">更换手机号</li>
        </ol>
    </section>

    <!-- Main content -->
    <section class="content">
        <div class="callout callout-info">
            <h4>特别提醒!</h4>
            因商户版手机号涉及到提现等财务功能，更换手机号必须严格把关。请审核人员认真仔细，否则后果自负！！！
        </div>
        <div class="col-md-12">
            <!-- Horizontal Form -->
            <div class="box box-info">
                <div class="box-header with-border">
                    <h3 class="box-title">手机号</h3>
                </div>
                <!-- /.box-header -->
                <!-- form start -->
                <form class="form-horizontal">
                    <div class="box-body">
                        <div class="form-group">
                            <label for="inputEmail3" class="col-sm-2 control-label">原手机号</label>

                            <div class="col-sm-10">
                                <input type="text" class="form-control" id="sh" placeholder="{$staffList.telephone}" readonly="readonly">
                            </div>
                        </div>
                        <div class="form-group">
                            <label for="inputPassword3" class="col-sm-2 control-label">新手机号</label>

                            <div class="col-sm-10">
                                <input type="text" class="form-control" id="newphone" placeholder="请输入新手机号...">
                            </div>
                        </div>
                        <div class="form-group">
                            <label for="inputPassword3" class="col-sm-2 control-label">验证码</label>

                            <div class="input-group col-sm-10" style=" padding-left: 15px;">
                                <input type="text" class="form-control" id="code" style=" width: 95%" placeholder="请输入验证码...">
                                <button type="button" class="btn btn-info btn-flat" onclick="sendcode()">发送</button>

                            </div>
                        </div>
                        <!--                        <div class="input-group input-group-sm">
                                                    
                                                    <input type="text" class="form-control">
                                                    <span class="input-group-btn">
                                                        <button type="button" class="btn btn-info btn-flat">发送!</button>
                                                    </span>
                                                </div>-->
                        <div class="form-group">
                            <div class="col-sm-offset-2 col-sm-10">
                                <div class="checkbox">
                                    <label>
                                        <input type="checkbox"> Remember me
                                    </label>
                                </div>
                            </div>
                        </div>
                    </div>
                    <!-- /.box-body -->
                    <div class="box-footer">
                        <button type="button" class="btn btn-default">慎重 慎重</button>
                        <button type="button" class="btn btn-info pull-right" onclick="changephone({$staffList.id})">更换手机号</button>&nbsp;&nbsp;
                    </div>
                    <!-- /.box-footer -->
                </form>
            </div>
        </div>
    </section>
    <!-- /.content -->
</div>
<script type="text/javascript">
    function changephone(id) {
        var newphone = document.getElementById("newphone").value;
        var code = document.getElementById("code").value;
        if (!code) {
            alert('请输入验证码');
            return;
        }
        $.ajax({
            url: "{:url('admin/Staff/changePhoneExe','','')}",
            type: 'POST',
            data: {
                'newphone': newphone,
                'id': id,
                'code': code
            },
            dataType: 'JSON',
            success: function (data) {
                Alert('提示', data.msg, null);
            }
        });
    }
    function sendcode() {
        var newphone = document.getElementById("newphone").value;
        if (!newphone) {
            alert('请输入手机号');
            return;
        }
        $.ajax({
            url: "{:url('admin/Staff/sendCode','','')}",
            type: 'POST',
            data: {
                'telephone': newphone,
                'type': 31
            },
            dataType: 'JSON',
            success: function (data) {
                Alert('提示', data.msg, null);
            }
        });
    }
</script>
<!-- foot -->
{include file='public/foot' /}
<!-- foot -->